package org.hzz.application.handler;

import io.gitee.pkmer.designpattern.strategy.AbstractExecuteStrategy;
import lombok.Setter;
import org.hzz.application.command.PauseCouponCmd;
import org.hzz.promotions.domain.service.CouponDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/8/31
 * 暂停优惠券发放Handler
 */
@Component
public class PauseCouponCmdHandler implements AbstractExecuteStrategy<PauseCouponCmd,Void> {

    @Setter(onMethod_ = @Autowired)
    private CouponDomainService couponDomainService;

    @Override
    public String mark() {
        return PauseCouponCmd.MARK;
    }

    @Override
    public void execute(PauseCouponCmd pauseCouponCmd) {
        couponDomainService.pauseCoupon(pauseCouponCmd.getId());
    }
}
